package com.jzr.medical.test;

import java.io.IOException;

public class Main {
    static String GLOBAL_URL = "http://localhost:8050/api/";
    public static void main(String[] args) throws IOException {
        int i=0;
        switch (i){
            case 0:{
                try {
                    System.out.println(0);
                    break;
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            case 1:{
                try{
                    System.out.println(1);
                    break;
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            case 2:{
                try{
                    System.out.println(2);
                    break;
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            default:{
                try {
                    System.out.println("default");
                    break;
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
        //hospitalPost();
        //bedGet();
        //roomGet();
        //deptGet();
        //nurseGet();
        //patientGet();
        //allergyGet();
        //doctorOrderGet();

//        String jsonStr = "{\"D\":\"100\",\"B\":\"200\",\"A\":\"300\"}";
//        ObjectMapper mapper = new ObjectMapper();
//        SortedMap<String,String> map = mapper.readValue(jsonStr,TreeMap.class);
//        for(Map.Entry<String,String> entry : map.entrySet()){
//            System.out.println(entry.getKey() + " : " + entry.getValue());
//        }

    }
    static void hospitalPost() throws IOException{
        String url = GLOBAL_URL + "hospital/post?B=10&A=20&C=300";
        String json = "{\n" +
                "    \"name\": \"宝田医院\",\n" +
                "    \"intro\": \"深圳宝田医院设置科室16个，急诊科，预防保健科，内科，外科，妇科，儿科，眼科，耳鼻喉，口腔科，皮肤科，中医科，中西医结合内科，检验科，医学影像科，推拿科，康复科。\",\n" +
                "    \"license\": \"11\",\n" +
                "    \"logoUrl\": \"\",\n" +
                "    \"address\": \"深圳市光明区公明街道薯田埔社区福庄路2号\",\n" +
                "    \"postCode\": \"\",\n" +
                "    \"phone\": \"深圳市光明区公明街道薯田埔社区福庄路2号\",\n" +
                "    \"email\": \"\",\n" +
                "    \"imageUrl\": \"http://www.xxx.com/xxx\",\n" +
                "    \"areaName\": \"\",\n" +
                "    \"masterName\": \"\",\n" +
                "    \"masterMobile\": \"123456789\",\n" +
                "    \"longitude\": \"\",\n" +
                "    \"latitude\": \"\",\n" +
                "    \"orgType\": \"\",\n" +
                "    \"level\": \"\",\n" +
                "    \"remark\": \"\"        \n" +
                "}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void deptGet() throws IOException{
        String url = GLOBAL_URL + "dept/get";
        String json = "";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void roomGet() throws IOException{
        String url = GLOBAL_URL + "room/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void bedGet() throws IOException{
        String url = GLOBAL_URL + "bed/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void doctorGet() throws IOException{
        String url = GLOBAL_URL + "doctor/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void nurseGet() throws IOException{
        String url = GLOBAL_URL + "nurse/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void patientGet() throws IOException{
        String url = GLOBAL_URL + "patient/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void allergyGet() throws IOException{
        String url = GLOBAL_URL + "allergy/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
    static void doctorOrderGet() throws IOException{
        String url = GLOBAL_URL + "doctorOrder/get";
        String json = "{\"deptCode\":\"1402\"}";
        String response = HttpUtil.post(url,json);
        System.out.println(response);
    }
}
